package cn.wolfcode.shop.api.domain;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Setter@Getter
public class OrderProduct extends BaseDomain{

    private Long orderId;

    private Long skuId;

    private String productName;

    private Short productNumber;

    private BigDecimal productPrice;

    private String skuAttr;

    public BigDecimal getAmount(){
        return productPrice.multiply(new BigDecimal(productNumber)).setScale(2, RoundingMode.HALF_UP);
    }

}